﻿
namespace LS.Nc6.Application.System
{
    /// <summary>
    /// 角色管理自定义方法
    /// </summary>
    public interface ISysRoleService : IBaseInterface<SysRoleEntity>
    {

        /// <summary>
        /// 保存角色及菜单
        /// </summary>
        /// <param name="model"></param>
        /// <param name="listModel"></param>
        /// <returns></returns>
        Task<int> InsertRoleMenu(SysRoleEntity model, List<SysRoleMenuEntity> listModel);

        /// <summary>
        /// 修改角色及菜单
        /// </summary>  
        /// <param name="model"></param>
        /// <param name="listModel"></param>
        /// <returns></returns>
        Task<int> UpdateRoleMenu(SysRoleEntity model, List<SysRoleMenuEntity> listModel);

        /// <summary>
        /// 判断当前角色代码是否可用
        /// </summary>
        /// <param name="id">角色Id</param>
        /// <param name="roleCode">角色code</param>
        /// <returns></returns>
        Task<bool> ExistsRoleCode(string id,string roleCode);

        /// <summary>
        /// 根据role code 获取菜单
        /// </summary>
        /// <param name="roleCode"></param>
        /// <returns></returns>
        Task<List<SysRoleMenuEntity>> RoleMenuList(string roleCode);

    }
}
